/**
 * Create in 2012-4-26.
 */
package kit4j.common.lang;

import java.util.Date;

/**
 * 
 * @author MiniKnife
 *
 */
public enum TimeUnit implements TimeUnitStrategy {

	CENTURIES(new CenturiesTimeUnitStrategy()), 
	YEARS(new YearsTimeUnitStrategy()), 
	MONTHS(new MonthsTimeUnitStrategy()),
	WEEKS(new WeeksTimeUnitStrategy()), 
	DAYS(new DaysTimeUnitStrategy()), 
	HOURS(new HoursTimeUnitStrategy()), 
	MINUTES(new MinutesTimeUnitStrategy()), 
	SECONDS(new SecondsTimeUnitStrategy()), 
	MILLISECONDS(new MillisecondsTimeUnitStrategy());
	
	private TimeUnitStrategy timeUnitStrategy;
	
	TimeUnit(TimeUnitStrategy timeUnitStrategy) {
		this.timeUnitStrategy = timeUnitStrategy;
	}

	/**
	 * @see kit4j.common.lang.TimeUnitStrategy#nextTime(java.util.Date)
	 */
	@Override
	public Date nextTime(Date originTime) {
		return timeUnitStrategy.nextTime(originTime);
	}
}
